import sys

from PySide2.QtCore import QTranslator
from PySide2.QtWidgets import QApplication, QStyleFactory, QSystemTrayIcon
from PySide2.QtGui import QFont, QIcon

import Resources

from SysTrayIcon import SysTrayIcon


if __name__ == "__main__":
    app = QApplication([])
    app.setOrganizationName("TieDan")
    app.setApplicationName("SystemUseTool")

    Ctlan = QTranslator()
    Ctlan.load(":/Language/language_zh_CN.qm")
    app.installTranslator(Ctlan)

    Qtlan = QTranslator()
    Qtlan.load(":/Language/qt_zh_CN.qm")
    app.installTranslator(Qtlan)

    app.setFont(QFont("Sim-Sun", 9, QFont.Normal, False))
    app.setStyle(QStyleFactory.create("Fusion"))

    TrayIco=SysTrayIcon(QIcon(":/Image/UsageTool.png"))
    TrayIco.show()

    app.setQuitOnLastWindowClosed(False)
    sys.exit(app.exec_())
